﻿using System;
using System.Diagnostics.Contracts;
using System.Windows.Data;

namespace AnthStat.WPF.Applications.Converters
{
    [ValueConversion(typeof(int), typeof(bool))]
    public sealed class LengthToEnabledConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value == null || value.ToString().Length == 0) return false;
            return true;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
